-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add function to check if cache contains a key #382
base: main
Are you sure you want to change the base?
Conversation
eb3ed48
to
0086967
Compare
Do we need this func? We have |
The main difference is that I also find it more readable to do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #382 +/- ##
==========================================
+ Coverage 89.08% 89.31% +0.23%
==========================================
Files 15 15
Lines 797 805 +8
==========================================
+ Hits 710 719 +9
Misses 73 73
+ Partials 14 13 -1
Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since @cristaloleg is fine with extending the interface let's merge it. Just one nitpic
return false | ||
} | ||
entryKey := readKeyFromEntry(wrappedEntry) | ||
s.lock.RUnlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cristaloleg do you think we should increment hit count here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deeply philosophical question. I'm fine to not increment it here. Leave it only for real value get.
Add a new function allowing to check if the cache contains the given key